package com.jeff.tianti.cms.dao;

import com.jeff.tianti.cms.entity.JobResumeMiddle;
import com.jeff.tianti.common.dao.CommonDao;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author xujianfang
 * @desc JobResumeMiddleDao�ӿ�
 * @date 2019-07-17
 */
public interface JobResumeMiddleDao extends JobResumeMiddleDaoCustom, CommonDao<JobResumeMiddle, String> {
    @Query(" from JobResumeMiddle j where j.uid = ?1 ")
    Page<JobResumeMiddle> findJobResMeddleListById(String uid, Pageable pageable);

    @Modifying
    @Query(value = " delete from job_resume_middle where job_id= ?1 and uid = ?2  ", nativeQuery = true)
    void deleteByJobIdAndUid(String jobId, String uid);

    List<JobResumeMiddle> findByResumeIdAndJobId(String resumeId, String jobId);
}